import 'package:flutter/material.dart';
import 'package:webview_flutter/webview_flutter.dart';
import 'package:wechat/app.dart';
import 'package:wechat/chat/search.dart';
import 'package:wechat/loading.dart';

final ThemeData mDefaultTheme = ThemeData(
  primaryColor: const Color(0xFF303030),
  colorScheme:
      const ColorScheme.light().copyWith(primary: const Color(0xFF303030)),
  scaffoldBackgroundColor: const Color(0xFFebebeb),
  cardColor: const Color(0xFF393a3f),
);

final WebViewController mWebViewController = WebViewController()
  ..enableZoom(true)
  ..loadRequest(Uri.parse('https://weixin.qq.com'));

void main() {
  runApp(MaterialApp(
    debugShowCheckedModeBanner: false,
    title: 'wechat',
    theme: mDefaultTheme,
    routes: <String, WidgetBuilder>{
      "/app": (BuildContext context) => const AppPage(),
      "/search": (_) => const SearchPage(),
      "/friends": (_) => Scaffold(
            appBar: AppBar(
              title: const Text('微信朋友圈'),
            ),
            body: WebViewWidget(controller: mWebViewController),
          )
    },
    home: const LoadingPage(),
  ));
}
